package enums;

import java.util.Objects;
import org.testng.annotations.Test;

public class EnumTest {



    @Test
    private void t1() {
        for (EnumWithCallBack value : EnumWithCallBack.values()) {


            if (Objects.nonNull(value.getMapping())) {
                System.out.println(value + ", Function: " + value.getMapping().apply(999));
            } else if (Objects.nonNull(value.getSupplier())) {
                System.out.println(value + ", Supplier: " + value.getSupplier().get());
            }

        }
    }

    @Test
    private void t2() {
        for (EnumWithCallBack2 value : EnumWithCallBack2.values()) {
//            value.getConsumer().accept(new Double(0));
        }

    }

}
